package com.example.simple_android.Manager;

import java.util.Map;

public abstract class AbstractManager<T, S> implements Manager<T, S> {

    protected Map<T, S> map;

    @Override
    public void register(T key, S value) {
        this.map.put(key, value);
    }

    @Override
    public void unregister(T key) {
        this.map.remove(key);
    }

    @Override
    public Map<T, S> lookups() {
        return map;
    }

    @Override
    public S lookup(T key) {
        return this.map.get(key);
    }

    @Override
    public void clear() {
        this.map.clear();
    }
}
